<?php

/*

  Treasure	$5

  Worth $3
  +1 Buy
  When you play this, the player to your left names a card. You can’t buy that card this turn.

 */

class Contraband extends Card implements iTreasure, iKingdom, iInfluence, iProsperity {

    public function __construct() {
        parent::__construct("Contraband", 5);
        $this->value = new Price(3);
        $this->undoPlay = false;
        $this->undoBuy = true;
    }

    public function getDescription() {
        return array(
            "Worth $3",
            "+1 Buy",
            "When you play this, the player to your left names a card. You can’t buy that card this turn.");
    }
    
    public function autoPlayNum(Game $game) {
        return -1;
    }
    
    public function play(Game $game, $isRealCard) {
        $game->addBuys(1);
         ScreenDisplay::addScreenMessage($game, true, "get +1 buy and +3$", "gets +1 buy and +3$");
        $name = $game->getNextPlayerName();

        $game->setPhase(Phase_Sleep);

        $allCards = $game->getBoardCardsByPrice();
        $output = MySocket::GetUserReply($game, Input_ChooseOne, $allCards, 1, 1, null, "Choose card to contraband", $name);
        $game->setPhase(Phase_Sleep, $name);
        $card_name = $output[0];
         ScreenDisplay::addScreenMessage($game, false, " and cant buy ".nicePrint($output), " and cant buy ".ScreenDisplay::$LMSG);
        $game->contrabandCard($card_name);
        $game->pushCardToInfluence($this);
        $this->influence($game);

        $game->cardPaymentFinished();
    }

    public function influence(Game $game) {
        $contrabandCards = $game->getContrabandCards();
        foreach ($contrabandCards as $card) {
            $game->setPriceForCard($card, new Price(PHP_INT_MAX, PHP_INT_MAX));
        }
    }

}

?>